home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Online / SpeakFreely / src / html.c < prev    next >
C/C++ Source or Header  |  2000-05-18  |  526b  |  39 lines

  1. /*
  2.  
  3.             HTML utility routines
  4.  
  5. */
  6.  
  7. #include "speakfree.h"
  8.  
  9. /*  OUTHTML  --  Transcribe a string to an HTML output file, quoting
  10.          HTML special characters as necessary.    */
  11.  
  12. void outHTML(fp, s)
  13.   FILE *fp;
  14.   char *s;
  15. {
  16.     int c;
  17.  
  18.     while ((c = *s++) != 0) {
  19.     switch (c) {
  20.  
  21.             case '&':
  22.                 fputs("&", fp);
  23.         break;
  24.  
  25.             case '<':
  26.                 fputs("<", fp);
  27.         break;
  28.  
  29.             case '>':
  30.                 fputs(">", fp);
  31.         break;
  32.  
  33.         default:
  34.         fputc(c, fp);
  35.         break;
  36.     }
  37.     }
  38. }
  39.